use "Barber_Bolton_Thrower_Replication_Data_LSQ.dta", clear

********
*Table 2
********

*Model 1
nbreg num_eos i.state_fe i.year divided_gov1 veto_proof house_polarization rule_review_scale governor_power governor_party_pres_vote ///
 governor_prior_vote gov_republican governor_election_year term_limited ln_legislative_staff ln_legislative_salary ln_state_income_growth ///
 if (gov_republican == 1 | gov_democrat == 1), cluster(govfe)

*this identifies how many executive orders are in the data that are included in the statistical models
gen inmodel = e(sample) == 1
egen totaleouse = sum(num_eos) if inmodel == 1 ///reference to this number of `Data and Methods' section

*Model 2
nbreg num_eos i.state_fe i.year i.divided_gov1##i.veto_proof house_polarization rule_review_scale governor_power governor_party_pres_vote ///
 governor_prior_vote gov_republican governor_election_year term_limited ln_legislative_staff ln_legislative_salary ln_state_income_growth ///
 if (gov_republican == 1 | gov_democrat == 1), cluster(govfe)

*Figure 2
*divided without veto-proof to unified
margins, at(divided_gov1 = (0 1) veto_proof = (0)) atmeans
display (13.80484-12.57999)/12.57999
*divided with veto-proof
margins, at(divided_gov1 = (0 1) veto_proof = (1 0)) atmeans
display (12.57999-8.324144)/8.324144
*divided without veto to divided with veto
display (13.80484-8.324144)/8.324144

*Model 3
nbreg num_eos i.state_fe i.year i.divided_gov1##c.house_polarization veto_proof rule_review_scale governor_power governor_party_pres_vote ///
 governor_prior_vote gov_republican governor_election_year term_limited ln_legislative_staff ln_legislative_salary ln_state_income_growth ///
 if (gov_republican == 1 | gov_democrat == 1), cluster(govfe)

*Description of Model 3 in paper
sum house_polarization, d
*10th percentile
margins, at(divided_gov1 = (1 0) house_polarization = (0.858))
*median
margins, dydx(divided_gov1) at(house_polarization = (1.38))
*90th percentile
margins, at(divided_gov1 = (1 0) house_polarization = (2.054)) atmeans

*Figure 3
margins, dydx(divided_gov1) at(house_polarization = (0.4(0.1)3.1)) level(90)
*copy this and save to .csv file to be plotted in R.

********
*Table 3
********

*Model 1
nbreg num_eos i.state_fe i.year i.divided_gov1##c.rule_review_scale veto_proof house_polarization governor_power governor_party_pres_vote ///
 governor_prior_vote gov_republican governor_election_year term_limited ln_legislative_staff ln_legislative_salary ln_state_income_growth ///
 if (gov_republican == 1 | gov_democrat == 1), cluster(govfe)

*Figure 4
margins, dydx(divided_gov1) at(rule_review_scale = 0) level(90)
margins, dydx(divided_gov1) at(rule_review_scale = 1) level(90)
margins, dydx(divided_gov1) at(rule_review_scale = 2) level(90)

*Model 2
nbreg num_eos i.state_fe i.year i.divided_gov1##c.rule_review_dichotomous veto_proof house_polarization governor_power governor_party_pres_vote ///
 governor_prior_vote gov_republican governor_election_year term_limited ln_legislative_staff ln_legislative_salary ln_state_income_growth ///
 if (gov_republican == 1 | gov_democrat == 1), cluster(govfe)

*Discussion of Model 2 in text
margins, at(divided_gov1 = (0 1) rule_review_dichotomous = (0 1))




